package top.lshaci.learning.alibaba.cloud.sentinel.hello.web;

import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.lshaci.learning.alibaba.cloud.sentinel.hello.service.HelloService;

/**
 * HelloController
 *
 * @author lshaci
 * @since 1.0.0
 */
@RestController
@AllArgsConstructor
@RequestMapping("/hello")
public class HelloController {

    private final HelloService service;

    @GetMapping(value = "/{name}")
    public String apiHello(@PathVariable String name) {
        return service.sayHello(name);
    }
}
